
#include "Messaging\Messages.h"
#include "CPlayerShip.h"
#include "CBlackBullet.h"
#include "CWhiteBullet.h"
#include "CRoundBlackBullet.h"
#include "CRoundWhiteBullet.h"
#include "CHomingBlackBullet.h"
#include "CHomingWhiteBullet.h"
#include "CEnemyRoamer.h"
#include "CEnemyBasicShooter.h"
#include "CEnemyHomingShooter.h"
#include "CEnemyBoss.h"
#include "CSGD_ObjectManager.h"

//////////////////////////////////////////////
//
//	CCreatePlayerBulletMsg
//
//////////////////////////////////////////////
CCreateBlackPlayerBulletMsg::CCreateBlackPlayerBulletMsg(float posX, float posY) : CBaseMessage (MSG_PLAYERSHIP_FIRE_BLACK)
{
	m_fPosX = posX + 13;
	m_fPosY = posY;
}

//////////////////////////////////////////////
//
//	CCreatePlayerBulletMsg
//
//////////////////////////////////////////////
CCreateWhitePlayerBulletMsg::CCreateWhitePlayerBulletMsg(float posX, float posY) : CBaseMessage (MSG_PLAYERSHIP_FIRE_WHITE)
{
	m_fPosX = posX + 13;
	m_fPosY = posY;
}

//////////////////////////////////////////////
//
//	CCreateRoundBlackBulletMsg
//
//////////////////////////////////////////////
CCreateRoundBlackBulletMsg::CCreateRoundBlackBulletMsg(float posX, float posY, float scaleX, float scaleY, float velX, float velY, float fDetonateTime) : CBaseMessage (MSG_ENEMY_FIRE_BLACK)
{
	m_fPosX = posX + 13;
	m_fPosY = posY + 20;
	m_fScaleX = scaleX;
	m_fScaleY = scaleY;
	m_fVelX = velX;
	m_fVelY = velY;
	m_fDetonationTime = fDetonateTime;
}

//////////////////////////////////////////////
//
//	CCreateRoundWhiteBulletMsg
//
//////////////////////////////////////////////
CCreateRoundWhiteBulletMsg::CCreateRoundWhiteBulletMsg(float posX, float posY, float scaleX, float scaleY, float velX, float velY, float fDetonateTime) : CBaseMessage (MSG_ENEMY_FIRE_WHITE)
{
	m_fPosX = posX + 13;
	m_fPosY = posY + 20;
	m_fScaleX = scaleX;
	m_fScaleY = scaleY;
	m_fVelX = velX;
	m_fVelY = velY;
	m_fDetonationTime = fDetonateTime;
}

//////////////////////////////////////////////
//
//	CCreateHomingBlackBulletMsg
//
//////////////////////////////////////////////
CCreateHomingBlackBulletMsg::CCreateHomingBlackBulletMsg(CPlayerShip* playerShip, float posX, float posY, float scaleX, float scaleY) : CBaseMessage (MSG_CREATE_BLACK_HOMING_BULLET)
{
	m_pShip = playerShip;
	m_fPosX = posX + 13;
	m_fPosY = posY + 20;
	m_fScaleX = scaleX;
	m_fScaleY = scaleY;
}

//////////////////////////////////////////////
//
//	CCreateHomingWhiteBulletMsg
//
//////////////////////////////////////////////
CCreateHomingWhiteBulletMsg::CCreateHomingWhiteBulletMsg(CPlayerShip* playerShip, float posX, float posY, float scaleX, float scaleY) : CBaseMessage (MSG_CREATE_WHITE_HOMING_BULLET)
{
	m_pShip = playerShip;
	m_fPosX = posX + 13;
	m_fPosY = posY + 20;
	m_fScaleX = scaleX;
	m_fScaleY = scaleY;
}


//////////////////////////////////////////////
//
//	CDestroyBlackPlayerBulletMsg
//
//////////////////////////////////////////////
//constructor
CDestroyBlackPlayerBulletMsg::CDestroyBlackPlayerBulletMsg(CBlackBullet* pBullet) : CBaseMessage (MSG_DESTROY_BLACK_PLAYER_BULLET)
{
	m_pBullet = pBullet;
	m_pBullet->AddRef();
}

//destructor
CDestroyBlackPlayerBulletMsg::~CDestroyBlackPlayerBulletMsg()
{
	if (m_pBullet)
	{
		m_pBullet->Release();
		m_pBullet = NULL;
	}
}

//////////////////////////////////////////////
//
//	CDestroyWhitePlayerBulletMsg
//
//////////////////////////////////////////////
//constructor
CDestroyWhitePlayerBulletMsg::CDestroyWhitePlayerBulletMsg(CWhiteBullet* pBullet) : CBaseMessage (MSG_DESTROY_BLACK_PLAYER_BULLET)
{
	m_pBullet = pBullet;
	m_pBullet->AddRef();
}

//destructor
CDestroyWhitePlayerBulletMsg::~CDestroyWhitePlayerBulletMsg()
{
	if (m_pBullet)
	{
		m_pBullet->Release();
		m_pBullet = NULL;
	}
}

//////////////////////////////////////////////
//
//	CDestroyRoundBlackBulletMsg
//
//////////////////////////////////////////////
//constructor
CDestroyRoundBlackBulletMsg::CDestroyRoundBlackBulletMsg(CRoundBlackBullet* pBullet) : CBaseMessage (MSG_DESTROY_ROUND_BLACK_BULLET)
{
	m_pBullet = pBullet;
	m_pBullet->AddRef();
}

//destructor
CDestroyRoundBlackBulletMsg::~CDestroyRoundBlackBulletMsg()
{
	if (m_pBullet)
	{
		m_pBullet->Release();
		m_pBullet = NULL;
	}
}

//////////////////////////////////////////////
//
//	CDestroyRoundWhiteBulletMsg
//
//////////////////////////////////////////////
//constructor
CDestroyRoundWhiteBulletMsg::CDestroyRoundWhiteBulletMsg(CRoundWhiteBullet* pBullet) : CBaseMessage (MSG_DESTROY_ROUND_WHITE_BULLET)
{
	m_pBullet = pBullet;
	m_pBullet->AddRef();
}

//destructor
CDestroyRoundWhiteBulletMsg::~CDestroyRoundWhiteBulletMsg()
{
	if (m_pBullet)
	{
		m_pBullet->Release();
		m_pBullet = NULL;
	}
}

//////////////////////////////////////////////
//
//	CDestroyHomingBlackBulletMsg
//
//////////////////////////////////////////////
//constructor
CDestroyHomingBlackBulletMsg::CDestroyHomingBlackBulletMsg(CHomingBlackBullet* pBullet) : CBaseMessage (MSG_DESTROY_HOMING_BLACK_BULLET)
{
	m_pBullet = pBullet;
	m_pBullet->AddRef();
}

//destructor
CDestroyHomingBlackBulletMsg::~CDestroyHomingBlackBulletMsg()
{
	if (m_pBullet)
	{
		m_pBullet->Release();
		m_pBullet = NULL;
	}
}

//////////////////////////////////////////////
//
//	CDestroyHomingWhiteBulletMsg
//
//////////////////////////////////////////////
//constructor
CDestroyHomingWhiteBulletMsg::CDestroyHomingWhiteBulletMsg(CHomingWhiteBullet* pBullet) : CBaseMessage (MSG_DESTROY_HOMING_WHITE_BULLET)
{
	m_pBullet = pBullet;
	m_pBullet->AddRef();
}

//destructor
CDestroyHomingWhiteBulletMsg::~CDestroyHomingWhiteBulletMsg()
{
	if (m_pBullet)
	{
		m_pBullet->Release();
		m_pBullet = NULL;
	}
}

//////////////////////////////////////////////
//
//	CCreateBlackRoamingEnemyMsg
//
//////////////////////////////////////////////
CCreateRoamingBlackEnemyMsg::CCreateRoamingBlackEnemyMsg(float posX, float posY, float velX, float velY) : CBaseMessage (MSG_CREATE_BLACK_ROAMING_ENEMY)
{
	m_fPosX = posX;
	m_fPosY = posY;
	m_fVelX = velX;
	m_fVelY = velY;
	m_nColor = MSG_BLACK;
}

//////////////////////////////////////////////
//
//	CDestroyRoamingEnemyMsg
//
//////////////////////////////////////////////
CDestroyRoamingEnemyMsg::CDestroyRoamingEnemyMsg(CEnemyRoamer* enemy) : CBaseMessage (MSG_DESTROY_ROAMING_ENEMY)
{
	m_pEnemy = enemy;
	m_pEnemy->AddRef();
	
}

CDestroyRoamingEnemyMsg::~CDestroyRoamingEnemyMsg()
{
	if (m_pEnemy)
	{
		m_pEnemy->Release();
		m_pEnemy = NULL;
	}
	
}

//////////////////////////////////////////////
//
//	CCreateRoamingWhiteEnemyMsg
//
//////////////////////////////////////////////
CCreateRoamingWhiteEnemyMsg::CCreateRoamingWhiteEnemyMsg(float posX, float posY, float velX, float velY) : CBaseMessage (MSG_CREATE_WHITE_ROAMING_ENEMY)
{
	m_fPosX = posX;
	m_fPosY = posY;
	m_fVelX = velX;
	m_fVelY = velY;
	m_nColor = MSG_WHITE;
}

//////////////////////////////////////////////
//
//	CCreateBlackBasicShooterEnemyMsg
//
//////////////////////////////////////////////
CCreateBasicShooterBlackEnemyMsg::CCreateBasicShooterBlackEnemyMsg(float posX, float posY, float velX, float velY) : CBaseMessage (MSG_CREATE_BLACK_BASIC_SHOOTER_ENEMY)
{
	m_fPosX = posX;
	m_fPosY = posY;
	m_fVelX = velX;
	m_fVelY = velY;
	m_nColor = MSG_BLACK;
}

//////////////////////////////////////////////
//
//	CDestroyBasicShooterEnemyMsg
//
//////////////////////////////////////////////
CDestroyBasicShooterEnemyMsg::CDestroyBasicShooterEnemyMsg(CEnemyBasicShooter* enemy) : CBaseMessage (MSG_DESTROY_BASIC_SHOOTER_ENEMY)
{
	m_pEnemy = enemy;
	m_pEnemy->AddRef();
	
}

CDestroyBasicShooterEnemyMsg::~CDestroyBasicShooterEnemyMsg()
{
	if (m_pEnemy)
	{
		m_pEnemy->Release();
		m_pEnemy = NULL;
	}
	
}

//////////////////////////////////////////////
//
//	CCreateWhiteBasicShooterEnemyMsg
//
//////////////////////////////////////////////
CCreateBasicShooterWhiteEnemyMsg::CCreateBasicShooterWhiteEnemyMsg(float posX, float posY, float velX, float velY) : CBaseMessage (MSG_CREATE_WHITE_BASIC_SHOOTER_ENEMY)
{
	m_fPosX = posX;
	m_fPosY = posY;
	m_fVelX = velX;
	m_fVelY = velY;
	m_nColor = MSG_WHITE;
}

//////////////////////////////////////////////
//
//	CCreateHomingShooterEnemyMsg
//
//////////////////////////////////////////////
CCreateHomingShooterEnemyMsg::CCreateHomingShooterEnemyMsg(int nColor, float posX, float posY, float velX, float velY) : CBaseMessage (MSG_CREATE_HOMING_SHOOTER_ENEMY)
{
	m_fPosX = posX;
	m_fPosY = posY;
	m_fVelX = velX;
	m_fVelY = velY;
	m_nColor = nColor;
}

//////////////////////////////////////////////
//
//	CDestroyHomingShooterEnemyMsg
//
//////////////////////////////////////////////
CDestroyHomingShooterEnemyMsg::CDestroyHomingShooterEnemyMsg(CEnemyHomingShooter* enemy) : CBaseMessage (MSG_DESTROY_HOMING_SHOOTER_ENEMY)
{
	m_pEnemy = enemy;
	m_pEnemy->AddRef();
	
}

CDestroyHomingShooterEnemyMsg::~CDestroyHomingShooterEnemyMsg()
{
	if (m_pEnemy)
	{
		m_pEnemy->Release();
		m_pEnemy = NULL;
	}
	
}

//////////////////////////////////////////////
//
//	CCreateBossEnemyMsg
//
//////////////////////////////////////////////
CCreateBossEnemyMsg::CCreateBossEnemyMsg(int nColor, float posX, float posY, float velX, float velY) : CBaseMessage (MSG_CREATE_BOSS_ENEMY)
{
	m_fPosX = posX;
	m_fPosY = posY;
	m_fVelX = velX;
	m_fVelY = velY;
	m_nColor = nColor;
}

//////////////////////////////////////////////
//
//	CDestroyBossEnemyMsg
//
//////////////////////////////////////////////
CDestroyBossEnemyMsg::CDestroyBossEnemyMsg(CEnemyBoss* enemy) : CBaseMessage (MSG_DESTROY_BOSS_ENEMY)
{
	m_pEnemy = enemy;
	m_pEnemy->AddRef();
	
}

CDestroyBossEnemyMsg::~CDestroyBossEnemyMsg()
{
	if (m_pEnemy)
	{
		m_pEnemy->Release();
		m_pEnemy = NULL;
	}
	
}

////////////////////////////////////////////////
////
////	CDestroyWhiteRoamingEnemyMsg
////
////////////////////////////////////////////////
//CDestroyWhiteRoamingEnemyMsg::CDestroyWhiteRoamingEnemyMsg(CEnemyRoamer* enemy)
//{
//	m_pEnemy = enemy;
//	m_pEnemy->AddRef();
//}
//
//CDestroyWhiteRoamingEnemyMsg::~CDestroyWhiteRoamingEnemyMsg()
//{
//	if (m_pEnemy)
//	{
//		m_pEnemy->Release();
//		m_pEnemy = NULL;
//	}
//}

